import io.coding.service.TestService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.annotation.Resource;
import java.sql.SQLException;

/**
 * Created by Administrator on 2014/8/19.
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations={
        "classpath*:spring-mvc.xml",
        "classpath*:spring-context-mybatis.xml",
        "classpath*:spring-context.xml"
      })
public class test extends AbstractJUnit4SpringContextTests {

    @Resource
    private TestService testService;

    @Test
    public void test() throws SQLException {
        System.out.println(testService.findAll());
    }

    public Object getBean(String beanName) {
        return applicationContext.getBean(beanName);
    }
}
